Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't use deprecated enum syntax #972

Merged
merged 1 commit into from
Feb 12, 2024
Merged

Don't use deprecated enum syntax #972

merged 1 commit into from
Feb 12, 2024

Conversation

etiennebarrie
Copy link
Member

@etiennebarrie etiennebarrie commented Feb 12, 2024

Fixes #968

Rails 7.2 will deprecate

enum status: [:pending, :failure, :success]

in favor of:

enum :status, [:pending, :failure, :success]

to avoid issues around the options that could conflict with the enum's values, see rails/rails#50987.

I decided to use a guard against the Rails version instead of simply checking the method's arity in order to make it easier to grep in the future when we remove support for Rails 6.1 (the new syntax was added in 7.0).

@etiennebarrie etiennebarrie merged commit 0840ee4 into main Feb 12, 2024
41 checks passed
@etiennebarrie etiennebarrie deleted the enum-deprecation branch February 12, 2024 14:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Weekly CI run failed
2 participants